package cn.tedu.front.modify.controller;

import cn.tedu.common.pojo.authentication.CurrentPrincipal;
import cn.tedu.common.web.JsonResult;
import cn.tedu.front.modify.pojo.param.DetailsUpdateParam;
import cn.tedu.front.modify.service.IUpdateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Slf4j
@RestController
@RequestMapping("/update")
public class UpdateController {
    @Autowired
    private IUpdateService iUpdateService;
    @PostMapping("/modify")
    public JsonResult modifyById(@AuthenticationPrincipal CurrentPrincipal principal
    , DetailsUpdateParam detailsUpdateParam){
        iUpdateService.updateInfo(principal,detailsUpdateParam);
        return JsonResult.ok();
    }
}
